checkbutton: Fix clicking on the last group member
authorMatthias Clasen <mclasen@redhat.com>
Sun, 30 Aug 2020 22:19:05 +0000 (18:19 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 31 Aug 2020 01:23:25 +0000 (21:23 -0400)
Clicking on the last group member was letting me
uncheck it, creating a radio group without active
item, which is not what we want.

gtk/gtkcheckbutton.c

index ac087f5079da49710a08a6a28631e343549afd3f..f9ba214ddd84473592f6e38544edc709436b2728 100644 (file)
@@ -264,7 +264,7 @@ click_released_cb (GtkGestureClick *gesture,
   GtkCheckButton *self = GTK_CHECK_BUTTON (widget);
   GtkCheckButtonPrivate *priv = gtk_check_button_get_instance_private (self);
 
-  if (priv->active && priv->group_prev)
+  if (priv->active && (priv->group_prev || priv->group_next))
     return;
 
   gtk_check_button_set_active (self, !priv->active);